import Vue from 'vue'
import VueRouter from 'vue-router'
import TeacherView from '@/views/TeacherView.vue'
import IndexView from '@/views/IndexView.vue'
import RoomView from '@/views/RoomView.vue'
import LoginView from "@/views/LoginView.vue";
import RegisterView from "@/views/RegisterView.vue";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/register',
        name: 'register',
        component: RegisterView
    },
    {
        path: '/index',
        name: 'index',
        component: IndexView,
        redirect: 'teacher',
        children: [
            {
                path: '/teacher',
                name: 'teacher',
                component: TeacherView
            },
            {
                path: '/room',
                name: 'room',
                component: RoomView
            },
        ]
    },
]

const router = new VueRouter({
    routes
})

export default router
